/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.sabatec.entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 
 * @author Daniel.Morais
 */
@Entity
@Table(name = "requestservicesabatec")
@NamedQueries({
		@NamedQuery(name = "RequestServiceSabatec.findAll", query = "SELECT r FROM RequestServiceSabatec r")
})
public class RequestServiceSabatec implements Serializable {
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Basic(optional = false)
	@Column(name = "id")
	private Integer id;
	@Basic(optional = false)
	@Column(name = "cliente")
	private String cliente;
	@Basic(optional = false)
	@Column(name = "emprendimento")
	private String emprendimento;
	@Basic(optional = false)
	@Column(name = "torre")
	private String torre;
	@Basic(optional = false)
	@Column(name = "unidade")
	private int unidade;
	@Basic(optional = false)
	@Column(name = "data")
	@Temporal(TemporalType.DATE)
	private Date data;
	@Basic(optional = false)
	@Column(name = "descrservico")
	private String descrservico;
	@Basic(optional = false)
	@Column(name = "servicoconcluido")
	private boolean servicoconcluido;
	@Basic(optional = false)
	@Column(name = "motivo")
	private String motivo;
	@OneToMany(cascade = CascadeType.ALL, mappedBy = "idservice")
	private Collection<ObraExecSabatec> obraexecsabatecCollection;
	@OneToMany(cascade = CascadeType.ALL, mappedBy = "idcliente")
	private Collection<Stuff> stuffCollection;

	public RequestServiceSabatec() {
	}

	public RequestServiceSabatec(Integer id) {
		this.id = id;
	}

	public RequestServiceSabatec(Integer id, String cliente,
			String emprendimento, String torre, int unidade, Date data,
			String descrservico, boolean servicoconcluido, String motivo) {
		this.id = id;
		this.cliente = cliente;
		this.emprendimento = emprendimento;
		this.torre = torre;
		this.unidade = unidade;
		this.data = data;
		this.descrservico = descrservico;
		this.servicoconcluido = servicoconcluido;
		this.motivo = motivo;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getCliente() {
		return cliente;
	}

	public void setCliente(String cliente) {
		this.cliente = cliente;
	}

	public String getEmprendimento() {
		return emprendimento;
	}

	public void setEmprendimento(String emprendimento) {
		this.emprendimento = emprendimento;
	}

	public String getTorre() {
		return torre;
	}

	public void setTorre(String torre) {
		this.torre = torre;
	}

	public int getUnidade() {
		return unidade;
	}

	public void setUnidade(int unidade) {
		this.unidade = unidade;
	}

	public Date getData() {
		return data;
	}

	public void setData(Date data) {
		this.data = data;
	}

	public String getDescrservico() {
		return descrservico;
	}

	public void setDescrservico(String descrservico) {
		this.descrservico = descrservico;
	}

	public boolean getServicoconcluido() {
		return servicoconcluido;
	}

	public void setServicoconcluido(boolean servicoconcluido) {
		this.servicoconcluido = servicoconcluido;
	}

	public String getMotivo() {
		return motivo;
	}

	public void setMotivo(String motivo) {
		this.motivo = motivo;
	}

	public Collection<ObraExecSabatec> getObraexecsabatecCollection() {
		return obraexecsabatecCollection;
	}

	public void setObraexecsabatecCollection(
			Collection<ObraExecSabatec> obraexecsabatecCollection) {
		this.obraexecsabatecCollection = obraexecsabatecCollection;
	}

	public Collection<Stuff> getStuffCollection() {
		return stuffCollection;
	}

	public void setStuffCollection(Collection<Stuff> stuffCollection) {
		this.stuffCollection = stuffCollection;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are
		// not set
		if (!(object instanceof RequestServiceSabatec)) {
			return false;
		}
		RequestServiceSabatec other = (RequestServiceSabatec) object;
		if ((this.id == null && other.id != null)
				|| (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "br.com.sabatec.RequestServiceSabatec[ id=" + id + " ]";
	}

}
